'use strict';
const uniID = require('uni-id');
const proParams = require('processing-parameters');
const db = uniCloud.database();
const dbCmd = db.command;
const collection = db.collection('admin-roles');
exports.main = async (event, context) => {
	let datas = proParams(event)
	let params = ''
	if(datas.data.params){
		params = datas.data.params
	}
	let action = datas.data.action
	let token = datas.event.headers.uniidtoken
	let type = require(`./modules/${action}.js`)
	return type({collection,dbCmd,params,token,uniID})
};
